<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box{
      width:200px;
      height: 200px;
      background: rgb(121, 120, 76);
    }
    .box2{
      width:200px;
      height: 200px;
      background: rgb(223, 219, 5);
    }
  </style>
</head>
<body>
  <div id="app">
    <button @click="change">{{ isShow?'消失':'显示' }}</button>
    <div class="box" v-if="isShow">if</div>
    <div class="box2" v-show="isShow">show</div>
  </div>
  <script src="./vue.js"></script>
  <script>
    const vm = new Vue({
      el:'#app',
      data:{
        isShow: false
      },
      methods:{
        change(){
          this.isShow = !this.isShow
        }
      }
    })
  </script>
</body>
</html>
